<%@page import="
java.io.IOException,
java.io.PrintWriter,
java.util.Enumeration,
javax.servlet.ServletConfig,
oracle.jbo.server.ConnectionPoolManagerFactory,
javax.servlet.ServletException,
oracle.jbo.pool.ResourcePool,
javax.servlet.http.HttpServlet,
oracle.jbo.pool.ResourcePoolManager,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse"%>
<html>
  <head><title>DumpConnectionPoolStatistics</title></head><%
    ResourcePoolManager poolMgr = (ResourcePoolManager)ConnectionPoolManagerFactory.getConnectionPoolManager();
    String poolname = request.getParameter("poolname");
    if (poolname == null || poolname.equals("")) {
      Enumeration keys = poolMgr.getResourcePoolKeys();
      if (keys != null) {
        out.println("<h3>List of Active Connection Pools</h3>");
        out.println("<ul>");
        while (keys.hasMoreElements()) {
          String s = (String)keys.nextElement();
          out.println("<li><code><a href='DumpConnectionPoolStatistics.jsp?poolname="+
          s+"'>"+s+"</a></code></li>");
        }
        out.println("</ul>");
      }
      else {
        out.println("No pools.");
      }
    }
    else {
      out.println("<h3>Pool Statistics for Pool '"+poolname+"'</h3>");
      out.println("<a href='DumpConnectionPoolStatistics.jsp'>Back to Pool List</a>");
      out.println("<hr><blockquote><pre>");
      ResourcePool pool =  (ResourcePool)poolMgr.getResourcePool(poolname);
      pool.dumpPoolStatistics(new PrintWriter(out));
      out.println("</pre></blockquote>");
    }
%>
